﻿using System.ComponentModel;
using System.Web.UI;
using Library.WebControls.SimpleTextEdit;

namespace Library.WebControls.SimpleGridView {
	/// <summary>
	/// Text grid column
	/// </summary>


	public class SpGvColumn : SpGvBaseColumn {
		/// <summary>
		/// Create text grid column instance
		/// </summary>
		public SpGvColumn() {
			EditTextEdit = new PrEditTextEdit(this);
		}
		/// <summary>
		/// Get Column type
		/// </summary>
		public override GridColumnType ColumnType {
			get { return GridColumnType.TextEdit; }
		}

		internal override BaseControl CreateClientEditControl() {
			return EditTextEdit;
		}
		/// <summary>
		/// Text edit control
		/// </summary>


		[PersistenceMode(PersistenceMode.InnerProperty)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

		public SpTextEdit EditTextEdit { get; private set; }
		[DesignTimeVisible(false)]
		[ToolboxItem(false)]
		[ParseChildren(true)]
		[Browsable(false)]
		[PersistChildren(false)]
		private class PrEditTextEdit : SpTextEdit {
			private readonly SpGvColumn _column;
			public PrEditTextEdit(SpGvColumn column) {
				_column = column;
			}
			[Browsable(false)]
			[EditorBrowsable(EditorBrowsableState.Never)]
			[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
			public override string ID {
				get {
					return base.ID;
				}
				set {
					base.ID = value;
				}
			}
			[Browsable(false)]
			[EditorBrowsable(EditorBrowsableState.Never)]
			[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
			public override string ClientName {
				get {
					return base.ClientName;
				}
				set {
					base.ClientName = value;
				}
			}
			[Browsable(false)]
			[EditorBrowsable(EditorBrowsableState.Never)]
			[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
			public override string CssFileName {
				get {
					return base.CssFileName;
				}
				set {
					base.CssFileName = value;
				}
			}
			[Browsable(false)]
			[EditorBrowsable(EditorBrowsableState.Never)]
			[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
			public override System.Web.UI.WebControls.Unit Width {
				get {
					return base.Width;
				}
				set {
					base.Width = value;
				}
			}







			public override bool Visible {
				get { return _column.Visible; }
				set {

				}
			}
		}

	}
}
